package org.jzb.test.route;

import io.quarkus.vertx.web.Param;
import io.quarkus.vertx.web.Route;
import io.vertx.core.json.JsonObject;
import io.vertx.ext.web.RoutingContext;

import javax.ws.rs.core.MediaType;

public class DlRoute {

  @Route(
      path = "/dl/services/:service/actions/:action/tokens/:token",
      produces = MediaType.APPLICATION_JSON)
  public void route(
      RoutingContext rc,
      @Param("service") String service,
      @Param("action") String action,
      @Param("token") String token) {
    final var jsonObject =
        new JsonObject().put("service", service).put("action", action).put("token", token);
    rc.response().end(jsonObject.toBuffer());
  }
}
